package referencePass;

/**
 * Created by Veronica on 2017/3/28.
 */
/*引用传递*/
class Ref1{
    int temp = 10;//声明变量,初始化为10
}

public class RefDemo01 {
    public static void main(String[] args) {
        Ref1 r1 = new Ref1();//声明变量，创建对象，实例化
        r1.temp = 20;
        System.out.println(r1.temp);
        tell(r1);
        System.out.println(r1.temp);
    }
    public static void tell(Ref1 r2){  //声明一个方法，传递参数
        r2.temp = 30;
    }
}
